package com.itheima.Stream流;


import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @Author 王加鑫
 * @Date 2021/5/17 14:42
 * @Version 1.0
 */
public class Demo03 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9,10,10,10,10,10));
        List<Integer> list1 = list.stream().filter(number -> number % 2 == 0).collect(Collectors.toList());
        Set<Integer> set = list.stream().filter(number -> number % 2 == 0).collect(Collectors.toSet());

        System.out.println(list1);
        System.out.println(set);


    }
}
